import pandas as pd
import json

with open("data/wb_region.json") as f:
    lreg = json.load(f)

    nm_reg = [d["name"] for d in lreg[1]]
    cd_reg = [d["code"] for d in lreg[1]]

    df_reg = pd.DataFrame({"name": nm_reg, "code": cd_reg})
    df_reg.to_csv("data/wb_region.csv", index=False)